<div class="row m-n">
    <div class="crumbs-bar">
        <div yb-crumbs></div>
    </div>
    <div tabset type="tab">
        <div tab heading="结算卡" active="activeFlag[0]" ng-click="changeTab(0)">
            <div class="row wrapper-y-sm">
                <div class="operate-bar col-xs-4 font-0">
                    <button class="btn btn-operate m-r-sm" ng-click="addPrePay()"
                            ng-disabled="!btnPermission.prePayAdd" translate translate-attr-title="{{!btnPermission.checkAdd?'无权限执行此操作':''}}">新增
                    </button>
                </div>
                <div class="search-bar wrapper-none col-xs-8">
                    <div class="btn-group m-l-xs pull-right">
                        <button type="button" class="btn btn-default base-color" ng-click="search()" translate translate-attr-title="刷新">
                            <i class="yb-icon ico-refresh"></i>
                        </button>
                        <button type="button" class="btn btn-default base-color" translate translate-attr-title="配置表格列"
                                ng-click="switchToolbar('ColConfig');">
                            <i class="yb-icon ico-set"></i>
                        </button>
                        <div class="btn btn-default base-color" ng-if="!!btnPermission.prePayExport">
                            <div translate translate-attr-title="导出">
                                <i class="yb-icon ico-export-o"></i>
                            </div>
                            <ul class="more-tool">
                                <li yb-download download-url="exportParam.sectionUrl"
                                    download-param="exportParam.sectionParam"
                                    download-key="ids">
                                    <i class="yb-icon ico-export-o"></i><span translate>导出</span>
                                </li>
                                <li yb-download download-url="exportParam.allUrl" download-param="condition" download-duration="3">
                                    <i class="yb-icon ico-export-o"></i><span translate>导出全部</span>
                                </li>
                            </ul>
                        </div>
                    </div>
                    <button class="btn-advance pull-right m-l-xs" ng-click="switchToolbar('AdvanceSearch')" translate-attr-title="高级搜索" translate="高级搜索more"></button>
                    <div class="input-group pull-right clearfix">
                        <div yb-form-clear class="form-control" ng-model="condition.purchaseOrgName" select-obj="selectDealer(true)"
                             clear-form="clearClient()" tips-name="客户"></div>
                    </div>
                </div>
            </div>
            <div yb-advance-search show-toolbar="toolbarConfig.showAdvanceSearch" search-data="search(1)"
                 reset-data="reset()">
                <div class="advance-search m-t-sm">
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>是否红冲</span>：</label>
                        <select ng-model="condition.discardFlag" class="form-control"
                                ng-options="item.id as (item.name | translate) for item in isReverseList">
                            <option value="" translate>请选择</option>
                        </select>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"><span translate>创建时间</span>：</label>
                        <input type="text" class="form-control date-picker" ng-model="condition.startDate"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(0)" is-open="datePickerFlag[0]"
                               ng-change="checkDate(condition, 'startDate', 'endDate')" close-text="关闭" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix m-b-none">
                        <label class="control-label"></label>
                        <label class="control-label wave-line">~</label>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"></label>
                        <input type="text" class="form-control date-picker" ng-model="condition.endDate"
                               datepicker-popup="{{'yyyy-MM-dd'}}" ng-click="switchDataPicker(1)" is-open="datePickerFlag[1]"
                               ng-change="checkDate(condition, 'startDate', 'endDate')" close-text="关闭" modal-size="small" readonly>
                    </div>
                    <div class="form-group clearfix">
                        <label class="control-label"><span translate>审核状态</span>：</label>
                        <select ng-model="condition.auditStatus" class="form-control"
                                ng-options="item.id as (item.name | translate) for item in auditStatusList">
                            <option value="" translate>请选择</option>
                        </select>
                    </div>
                </div>
            </div>
            <div yb-col-config show-toolbar="toolbarConfig.showColConfig" ng-model="tableConfig" col-fixed="true"
                 has-check-col="true" set-tb-style="setFixedWidth()"></div>
            <div class="main-area">
                <div yb-table-fixed class="table-fixed-wrap fix-left" ele-count="4" scroll-area="right">
                    <div class="th-fixed">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <thead>
                            <tr>
                                <th width="40" class="text-center th-check border-l-none">
                                    <div yb-check-box yb-checked="markInfo.allChecked" yb-click="selectAll()"></div>
                                </th>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)"
                                    ng-show="!!itemCol.isShow && !!itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol" target-width="tableConfig.fixedWidth"
                                         fixed-width="tbStyle.billFixedWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="th-scroll-x" ng-style="tbStyle.billFixedWidth">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <thead>
                            <tr>
                                <th ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}"
                                    ng-click="toSort(tableConfig.tableCol, $index)"
                                    ng-show="!!itemCol.isShow && !itemCol.isFixed">
                                    <div yb-thead-operate ng-model="itemCol"
                                         target-width="tableConfig.scrollWidth"></div>
                                </th>
                            </tr>
                            </thead>
                        </table>
                    </div>
                    <div class="td-scroll-y" ng-show="dataList.length > 0">
                        <table class="table-fixed border-none" width="{{tableConfig.fixedWidth}}">
                            <tbody>
                            <tr ng-repeat="item in dataList track by $index" ng-click="selectRow($index)">
                                <td width="40" class="text-center border-l-none">
                                    <div yb-check-box yb-checked="item.isChecked"
                                         yb-click="selectSingle(item, dataList, 'Bill')"></div>
                                </td>
                                <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index"
                                    width="{{itemCol.width}}" ng-show="!!itemCol.isShow && !!itemCol.isFixed"
                                    title="{{item[itemCol.dataField]}}">
                                    <div>
                                        <button type="button" class="btn btn-operate m-r-xs"
                                                ng-click="goDiscard(item)"
                                                ng-disabled="!!item.discardFlag||!btnPermission.prePayReverse"
                                                translate translate-attr-title="{{!btnPermission.prePayReverse?'无权限执行此操作':''}}">红冲
                                        </button>
                                        <button type="button" class="btn btn-operate m-r-xs"
                                            ng-disabled="item.auditStatus==1"
                                            translate
                                            ng-click="go2checkData(item)">审核</button>
                                        <button type="button" class="btn btn-operate m-r-xs" ng-click="printBill(item)" translate>打印</button>
                                    </div>
                                </td>
                            </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="td-scroll" ng-show="dataList.length > 0" ng-style="tbStyle.billFixedWidth" style="border-left:none;">
                        <table class="table-fixed border-none" width="{{tableConfig.scrollWidth}}">
                            <tbody style="border-left:solid 1px #d6d6d6">
                                <tr ng-repeat="item in dataList track by $index" ng-click="selectRow($index)">
                                    <td class="spill-dots" ng-repeat="itemCol in tableConfig.tableCol track by $index" width="{{itemCol.width}}"
                                        ng-show="!!itemCol.isShow && !itemCol.isFixed" title="{{item[itemCol.dataField]}}">
                                        <div ng-switch="itemCol.type">
                                            <div ng-switch-when="click">
                                                <a class="btn-operate m-r-xs" ng-class="{'danger-color': !!item.discardFlag}" ng-click="tdClick(item, itemCol.clickFn)">
                                                    {{item[itemCol.dataField]}}
                                                </a>
                                            </div>
                                            <div ng-switch-default class="spill-dots">
                                                <span ng-class="{'danger-color': !!item.discardFlag}">{{item[itemCol.dataField]}}</span>
                                            </div>
                                        </div>
                                    </td>
                                </tr>
                            </tbody>
                        </table>
                    </div>
                    <div class="no-data w-full text-center p-t" ng-show="dataList.length === 0" translate>暂时没有数据</div>
                </div>
            </div>
            <div class="bottom-area page-bar wrapper-y-sm clearfix">
                <div yb-check-box class="m-t-xs m-r-sm" yb-checked="markInfo.allChecked" yb-check-name="全选"
                     yb-click="selectAll()"></div>
                <div yb-page-info ng-model="pageInfo" yb-refresh="search()"></div>
            </div>
        </div>
        <div tab heading="新增" active="activeFlag[1]" ng-if="activeFlag[1]">
            <div class="main-area d-t-35 d-b-60">
                <form name="form" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>客户名称</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" name="clientName" class="form-control light-bg" ng-model="detailInfo.customerName"
                                   ng-click="selectDealer()" required yb-focus readonly translate translate-attr-placeholder="请选择" >
                        </div>
                        <div class="col-xs-4 msg-block" ng-show="form.clientName.$dirty || (form.clientName.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.clientName.$error.required && !form.clientName.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请选择</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>充值金额</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input yb-number-input type="text" class="form-control" ng-model="detailInfo.transactionAmount" name="transactionAmount"
                                   max="100000000" required maxlength="12" disable-decimal="false" decimal-places="3">
                        </div>
                        <div class="col-xs-4 msg-block" ng-show="form.transactionAmount.$dirty || (form.transactionAmount.$invalid && submitted)">
                            <div class="error-msg" ng-if="form.transactionAmount.$error.required && !form.transactionAmount.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span> 
                            </div>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><span translate>付款方式</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <select ng-model="detailInfo.payType" class="form-control"
                                    ng-options="item.id as (item.name | translate) for item in payTypeList">
                                <option value="" translate>请选择</option>
                            </select>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><span translate>结算方式</span>：</label>
                        <div class="col-xs-5 control-label" style="text-align: left;">{{detailInfo.settleType}}</div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><span translate>打款时间</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" class="form-control date-picker" ng-model="detailInfo.paymentDate"
                               datepicker-popup="{{'yyyy-MM-dd'}}"
                               ng-click="showCreateDateStart = !showCreateDateStart"
                               is-open="showCreateDateStart"
                               close-text="关闭" modal-size="small" readonly>
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><span translate>打款账号</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" class="form-control" ng-model="detailInfo.paymentAccount" maxlength="50">
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 control-label"><span translate>打款银行</span>：</label>
                        <div class="col-xs-5 wrapper-none">
                            <input type="text" class="form-control" ng-model="detailInfo.paymentBank">
                        </div>
                    </div>
                    <div class="form-group m-b-sm">
                        <label class="col-xs-2 control-label"><span translate>备注</span>：</label>
                        <label class="col-xs-5 control-label p-l-n text-left clearfix">
                            <textarea yb-word-count max-size="100" name="auditNote" class="form-control full" ng-model="detailInfo.remark"
                            translate translate-attr-placeholder="请填写"></textarea>
                        </label>
                    </div>
                    <div class="form-group save-bar m-t-md">
                        <label class="col-xs-2 control-label"></label>
                        <div class="col-xs-5 wrapper-none">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="saveData(form.$valid)" translate>
                                保存
                            </button>
                            <button type="button" class="btn btn-default" ng-click="cancel(1)" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div tab heading="红冲" active="activeFlag[2]" ng-if="activeFlag[2]">
            <div class="main-area d-t-35 d-b-60">
                <form name="discardForm" class="main-wrap form-horizontal single-col p-t clearfix" novalidate>
                    <div class="form-group m-b-sm">
                        <label class="col-xs-2 control-label"><i>*</i><span translate>备注</span>：</label>
                        <label class="col-xs-5 control-label p-l-n text-left clearfix">
                            <textarea yb-word-count max-size="100" name="discardRemark" required class="form-control full" ng-model="detailInfo.discardRemark"
                            translate translate-attr-placeholder="请填写"></textarea>
                        </label>
                        <div class="col-xs-4 msg-block" ng-show="discardForm.discardRemark.$dirty || (discardForm.discardRemark.$invalid && submitted)">
                            <div class="error-msg" ng-if="discardForm.discardRemark.$error.required && !discardForm.discardRemark.focused">
                                <i class="yb-icon ico-times-circular"></i><span translate>必填项，请填写</span>
                            </div>
                        </div>
                    </div>
                    <div class="form-group save-bar m-t-md">
                        <label class="col-xs-2 control-label"></label>
                        <div class="col-xs-5 wrapper-none">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="confirmDiscard(discardForm.$valid)" translate>
                                提交
                            </button>
                            <button type="button" class="btn btn-default" ng-click="cancel()" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
        <div tab heading="审核" active="activeFlag[3]" ng-if="activeFlag[3]">
            <div class="main-area d-t-35 d-b-60">
                <form class="main-wrap form-horizontal single-col p-t clearfix">
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>客户名称</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.customerName || '-'}}">
                            {{detailInfo.customerName || '-'}}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>充值金额</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.transactionAmount || '-'}}">
                            {{detailInfo.transactionAmount || '-'}}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>付款方式</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.payTypeF || '-'}}">
                            {{detailInfo.payTypeF || '-'}}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>结算方式</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.settleType || '-'}}">
                            {{detailInfo.settleType || '-'}}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>打款时间</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.paymentDateF || '-'}}">
                            {{detailInfo.paymentDateF || '-'}}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>打款账号</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.paymentAccount || '-'}}">
                            {{detailInfo.paymentAccount || '-'}}
                        </div>
                    </div>
                    <div class="form-group">
                        <label class="col-xs-2 m-b-n text-right"><span translate>打款银行</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.paymentBank || '-'}}">
                            {{detailInfo.paymentBank || '-'}}
                        </div>
                    </div>
                    <div class="form-group m-b-sm">
                        <label class="col-xs-2 m-b-n text-right"><span translate>备注</span>：</label>
                        <div class="col-xs-5 wrapper-none spill-dots" title="{{detailInfo.remark || '-'}}">
                             {{detailInfo.remark || '-'}}
                        </div>
                    </div>
                    <div class="form-group save-bar m-t-md">
                        <label class="col-xs-2 control-label"></label>
                        <div class="col-xs-5 wrapper-none">
                            <button type="button" class="btn btn-primary m-r-sm" ng-click="checkData(detailInfo.id)" translate>通过</button>
                            <button type="button" class="btn btn-default" ng-click="cancel(1)" translate>取消</button>
                        </div>
                    </div>
                </form>
            </div>
        </div>
    </div>
</div>